<script type="text/javascript" src="../js/common.js"></script>
<script src="http://tamnguyen.gencrm.com/include/calendar/vn-cal.js" type="text/javascript">
</script>
<script src="http://tamnguyen.gencrm.com/include/calendar/gencal.js" type="text/javascript">
</script>
<script src="http://tamnguyen.gencrm.com/include/calendar/lang/vi.js" type="text/javascript">
</script>

<link rel="stylesheet" href="../skins/css/jscal2.css" type="text/css" />
<link rel="stylesheet" href="../skins/css/border-radius.css" type="text/css" />
<link rel="stylesheet" href="../skins/css/steel.css" type="text/css" />

<script language="javascript">
function validate_form(thisform)
{
with (thisform)
{
		if (validate_required(khachhang,"Bạn chưa chọn khách hàng !")==false)
			{khachhang.focus();return false;}
		if (validate_required(sotien,"Bạn chưa nhập số tiền thu !")==false)
			{sotien.focus();return false;}
}
}
</script>

<!-- overlay -->
<div id="global">
	<div id="overlay" onclick="parent_disable();">		
	</div>
</div>
<!-- end overlay -->
<?php 
	$id=$_GET['id'];
	$sql=mysql_query("select
							id,
							kh_id,
							sotien,
							time,
							description
						from thu_chi
					where id='$id'
					");
	$row_sua=mysql_fetch_array($sql);
?>
<form style="padding:0; margin:0" action="index.php?tn=contract&hd=phieuchi_xl" method="post" onsubmit="return validate_form(this);" name="frmAddMessage" enctype="multipart/form-data" id="theform">
         <input type="hidden" name="id" value="<?php echo $row_sua['id'];?>" />
        <div class="clear" style="height:5px"></div>
        <div class="bodycontent"> 
        <table class="box-vang" border="0" cellpadding="0" cellspacing="0" width="100%">
          <tbody><tr>
            <td class="t-l" width="8px"></td>
            <td class="t-c"></td>
            <td class="t-r" width="8px"></td>
          </tr>
          <tr class="light">
            <td class="c-l"></td>
            <td class="c-c"><table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tbody><tr class="light">
                  <td class="title-red" colspan="2" align="left" id="canhan_tiemnang">&nbsp;Sửa phiếu chi</td>
                  
                </tr>
				 <tr>
                 <td colspan="2">
                   
				   <div id="customer_info" style="display: block;">
                       <table width="100%">
					    <tr class="light">
                  
                 <td>
         			<table width="100%">                   
                      <tr>
                       	<td align="right">Khách hàng</td>
                      	<td>
                         <?php 
							$sql_kh=mysql_query("select id,name_kh,name_com from customers where id='".$row_sua['kh_id']."'");
							$row_kh=mysql_fetch_array($sql_kh);
						?>
                        	<input type="hidden" name="Kha_Id" id="Kha_Id">
                            <input type="hidden" name="kh_id" value="<?php echo $row_sua['kh_id'];?>" />
                        	<input type="text" name="khachhang" style="width:300px;" id="khachhang" readonly="readonly" value="<?php echo $row_kh['name_kh'];echo $row_kh['name_com']?>"/>
                            <span style="color:#F00"> *</span>
                            <img src="../skins/images/btn_Lookup.png" onclick="popup('modules/customers/popupKH.php',800,500);" align="absmiddle">
                    <img width="16px" height="16px" align="absmiddle" onclick="document.getElementById(&#39;Kha_Id&#39;).value=&#39;&#39;;document.getElementById(&#39;khachhang&#39;).value=&#39;&#39;;" alt="del" src="../skins/images/Clear.gif">
                        </td>
                  	</tr>
                     <tr>
                       		<td align="right">Ngày chi</td>
                            <td>
                            	<input type="text"  id="ngaychi" name="ngaychi" style="width:300px;" value="<?php echo $row_sua['time'];?>">
                           
                            </td>
                      </tr>
                      <tr>
                       		<td align="right">Số tiền chi</td>
                            <td>
                            	<input type="text" id="sotien"  name="sotien" style="width:300px;" value="<?php echo $row_sua['sotien'];?>" ><span style="color:#F00"> *</span>
                           
                            </td>
                      </tr>
                      <tr>
                       		<td align="right">Diễn giải</td>
                            <td>
                            	<textarea style="width:500px; height:100px" name="diengiai"><?php echo $row_sua['description'];?></textarea>
                           
                            </td>
                      </tr>
                    </table> 
                  </td> 
                </tr> 

				     </table>
                </div>
                
               <script>
	var cal = Calendar.setup({
	  onSelect: function(cal) { cal.hide() },
	  weekNumbers: true
  });
	cal.manageFields("ngaychi", "ngaychi", "%d/%m/%Y");
	
	</script>
			   </td></tr>  
                <tr><td height="10px"></td></tr>
                <tr><td colspan="2" style="padding-left:150px;"><input class="buttonnew" name="submit" id="submit" value="Lưu lại" type="submit">&nbsp;<input class="buttonnew" name="submit" id="submit" value="Hủy bỏ" type="submit"></td></tr>
                
              </tbody> </table></td>
            <td class="c-r"></td>
          </tr>
          <tr>
            <td class="b-l"></td>
            <td class="b-c"></td>
            <td class="b-r"></td>
          </tr>
        </tbody></table>
        
</form>
	  

